package com.itlaobing.annotation.controller;


import com.itlaobing.annotation.entity.Student;
import com.itlaobing.annotation.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;

import java.util.logging.Logger;

@Controller("studentController")
public class StudentController {
    private Logger logger = Logger.getLogger( this.getClass().getName() );

    @Autowired                      //自动注入根据 Type
    @Qualifier("studentServiceImpl")//自动注入根据 Name，
    private StudentService ss;

    public void signUp(Student s){
        logger.info( "学生注册" );
        ss.saveStudent(s);
    }

    public StudentService getSs() {
        return ss;
    }

    public void setSs(StudentService ss) {
        this.ss = ss;
    }
}
